<?php
class number{
	function PrintMinNumber($numbers){
		$count = count($numbers);
		for ($i=0; $i < $count; $i++) { 
			for ($j=$i+1; $j < $count; $j++) { 
				if(intval($numbers[$i].''.$numbers[$j])>intval($numbers[$j].''.$numbers[$i])){
					$temp = $numbers[$i];
					$numbers[$i]=$numbers[$j];
					$numbers[$j]=$temp;
				}
			}
		}
		return intval(implode('', $numbers));
	}
}
$arr = array(3,32,321);
$data = new number;
print_r($data->PrintMinNumber($arr));
?>